/*
 * Copyright 2011 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.orkut.androidexample;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainMenuActivity extends ListActivity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setListAdapter(new ArrayAdapter<String>(this, R.layout.listitem_big,
				new String[] { "My Profile", "My Friends", "Set My Status", "Log Out" }));
	}

	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		
		if (position == 0) {
			Intent i = new Intent(this, ShowProfileActivity.class);
			i.putExtra("userid", "");
			startActivity(i);
		}
		else if (position == 1) {
			Intent i = new Intent(this, ShowFriendsActivity.class);
			startActivity(i);			
		}
		else if (position == 2) {
			Intent i = new Intent(this, SetStatusActivity.class);
			startActivity(i);
		}
		else if (position == 3) {
			Intent i = new Intent(this, WelcomeActivity.class);
			i.putExtra("logout", true);
			startActivity(i);
			finish();
		}
	}
	
	
}
